<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>跨域</title>
	<script type="text/javascript" src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
	<script type="text/javascript">
		$.ajax({
			url: "http://localhost:8080/district/list",
			type: "GET",
			data: null,
			dataType: "json",
			success: function(res){
				if(res.code == 0){
					var jsonArray = res.data;
					for(var i = 0;i < jsonArray.length;i++){
						var json = jsonArray[i];
						console.log(json.name);
					}
				}	
			},
			error: function(){
				console.log("cold,cold……");
			}
		});
	</script>
</head>
<body>

</body>
</html>